<include file="../Public/header.html" />
<link href="__PUBLIC__/Css/user.css" rel="stylesheet" type="text/css" />
<link href="__PUBLIC__/Css/orderDetail.css" rel="stylesheet" type="text/css" />

<script type="text/javascript" src="__PUBLIC__/Js/user/common.js" charset="UTF-8"></script>
<script type="text/javascript">
    
    function initlistStyle(){
        $(".pb_list").find('.pb_item').hover(
          function () {
            $(this).addClass("bg_hover");
          },
          function () {
            $(this).removeClass("bg_hover");
          }
        );
    }
    function goPage(pno){
 		$.kajax({      
			url:"{:U('User://Account/ajxPhonebook')}",      
			type:'post', //数据发送方式  
			data:{pno:pno,stype:'list'} ,    
			async: false ,//同步方式     
			success: function(html){ 
				$('#ajx_show_area').html(html);
			}
		});
 	}
    
    function addPBook(){
    	//$('#ajx_show_area').html($('#show_loading_html').html());
    	$.kajax({      
    		url:"{:U('User://Account/addPhonebook')}",      
    		type:'post', //数据发送方式  
    		data:{} ,    
    		async: false ,//同步方式     
    		success: function(html){ 
    			ui.box.close();
				ui.box.show(html,{title:'添加手机号码'});
    		}
    	});
    }

    function showModifyPbook(pbid,obj){
    	//alert(1);
    	ui.confirm(obj,
    				"修改姓名：<input type='text' class='do_input s_input' "
    				+ "value='"+$('#pb_name_'+pbid).text()+"'  style='width:100px;height: 20px; font-size: 12px;line-height: 20px;' id='modify_pbook_name' max='12'/>");
    				
    }
    function doModifyPbook(pbid,mobile_){
    	var new_name = $('#modify_pbook_name').val();
    	$.kajax({      
    		ajx_rtn_type:'JSON',
    		url:"{:U('User://Account/doModifyPbook')}",      
    		type:'post', //数据发送方式  
    		data:{mobile:mobile_,name:new_name} ,    
    		async: false ,//同步方式     
    		success: function(objson){ 
    						if(objson.status==1){
    							k_success(objson.msg);
    							$('#pb_name_'+pbid).text(new_name);
    						}else{
    							k_error(objson.msg);
    						}
    		}
    	});
    }

    function doDeletePbook(mobile_){
    	$.kajax({      
    		ajx_rtn_type:'JSON',
    		url:"{:U('User://Account/doDeletePbook')}",      
    		type:'post', //数据发送方式  
    		data:{mobile:mobile_} ,    
    		async: false ,//同步方式     
    		success: function(objson){ 
    						if(objson.status==1){
    							k_success(objson.msg);
    							goPage(1);
    						}else{
    							k_error(objson.msg);
    						}
    		}
    	});
    }
</script>

<div id="mainWrapper">

	<div id="main">

		<include file="../User/Tpl/default/Public/user_left_nav_box.html" />
  
  		<div id="right_box">
  			<div class="item_top" id="top_nav">
  				
				<ul>
					<li class="top_bar top-bar-wide top_baron" rel='list' onclick="goPage(1);">{$userNavDict[MODULE_NAME][ACTION_NAME]}</li>
					<li class="top_bar top-bar-wide" rel='add' onclick="addPBook();">添加手机号</li>
				</ul>
			</div>
			<div class="k_desc_div" style="margin:20px 0 15px 0px;">
				<div class="k_icon k_bulb"></div>
				<strong>电话薄在输入收礼人手机号时读取，便于快速完成手机号码录入！</strong>
			</div>	
  			<div id="ajx_show_area">
			  	<include file="../User/Tpl/default/Account/phonebook_list_box.html" />
			</div>
			<div id="clear"></div>
	</div>
</div>

<include file="../Public/footer.html" />